package com.example.selflearning.domain;
import lombok.Data;
/**
 * Created by yangjingzhi on 2019/5/29.
 */
@Data
public class DataObject {
    private  String data;

    private int verticesSize;
    public DataObject(String data){
        System.out.println("come in DataObject contruct method "+data);
        this.data=data;
        this.verticesSize=10;
    }

    public  DataObject(String data,int verticesSize){
        this.data=data;
        this.verticesSize=verticesSize;
    }

    public  DataObject(String data,int verticesSize,int refresh){
        System.out.println("come in DataObject refresh contruct method "+data);
        this.data=data+ System.currentTimeMillis();
        this.verticesSize=verticesSize;
    }
    private static int objectCounter = 0;
    // standard constructors/getters


    public static DataObject get(String data) {
        System.out.println("come in DataObject get method "+data);
        objectCounter++;
        return new DataObject(data);
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public int getVerticesSize() {
        return verticesSize;
    }

    public void setVerticesSize(int verticesSize) {
        this.verticesSize = verticesSize;
    }

    public static int getObjectCounter() {
        return objectCounter;
    }

    public static void setObjectCounter(int objectCounter) {
        DataObject.objectCounter = objectCounter;
    }
}

